//账号接口模块

//引入工具函数
import request from '@/utils/request'

//登录接口函数
export const checkLoginReq = data => {
    return request({
        method: 'post',
        url: '/users/checkLogin',
        data,
    })
}

//账号列表
export const getAccountList = params => {
    return request({
        method: 'get',
        url: '/users/list',
        params,
    })
}

//删除账号
export const delUserAccount = params => {
    return request({
        method: 'get',
        url: '/users/del',
        params
    })
}

//添加账号
export const addAcount = data => {
    return request({
        method: 'post',
        url: '/users/add',
        data
    })
}

//编辑确认修改
export const editAccount = data => {
    return request({
        method: 'post',
        url: '/users/edit',
        data
    })
}

//批量删除
export const batchAccount = data => {
    return request({
        method: 'post',
        url: '/users/batchdel',
        data
    })
}

//个人中心
export const userInfo = () => {
    return request({
        method: 'get',
        url: '/users/info',
    })
}

//上传头像
export const updateUserAvatarReq = params => {
    return request({
        method: 'get',
        url: '/users/avataredit',
        params
    })
}

//检查账号是否重复
export const userAccountRepeat = data => {
    return request({
        method: 'post',
        url: '/users/repeat',
        data
    })
}

//修改密码
export const editpwd = data => {
    return request({
        method: 'post',
        url: '/users/editpwd',
        data
    })
}

//确定原密码是否正确
export const checkOldPwd = params => {
    return request({
        method: 'get',
        url: '/users/checkoldpwd',
        params
    })
}